package org.htmlparser.sax;

import org.htmlparser.util.ParserException;
import org.htmlparser.util.ParserFeedback;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class Feedback
  implements ParserFeedback
{
  protected ErrorHandler mErrorHandler;
  protected Locator mLocator;

  public Feedback(ErrorHandler paramErrorHandler, Locator paramLocator)
  {
    this.mErrorHandler = paramErrorHandler;
    this.mLocator = paramLocator;
  }

  public void error(String paramString, ParserException paramParserException)
  {
    try
    {
      this.mErrorHandler.error(new SAXParseException(paramString, this.mLocator, paramParserException));
      return;
    }
    catch (SAXException localSAXException)
    {
      localSAXException.printStackTrace();
    }
  }

  public void info(String paramString)
  {
  }

  public void warning(String paramString)
  {
    try
    {
      this.mErrorHandler.warning(new SAXParseException(paramString, this.mLocator));
      return;
    }
    catch (SAXException localSAXException)
    {
      localSAXException.printStackTrace();
    }
  }
}